package Eyjafjalla.power;

import Eyjafjalla.action.MakeTempCardInCloudAction;
import Eyjafjalla.card.skill.Songs_Eyjafjalla;
import Eyjafjalla.character.Eyjafjalla;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.megacrit.cardcrawl.actions.common.MakeTempCardInHandAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.helpers.ImageMaster;
import com.megacrit.cardcrawl.localization.PowerStrings;

public class PinkOceanPower extends AbstractEyjafjallaPower {
    public static final String POWER_ID = "eyjafjalla:PinkOceanPower";
    private static final PowerStrings powerStrings;

    public PinkOceanPower(AbstractCreature owner){
        this.name = powerStrings.NAME;
        this.ID = POWER_ID;
        this.owner = owner;
        this.cloudy = this.owner instanceof Eyjafjalla;
        String path128 = "EyjafjallaResources/img/power/PinkOceanPower_84.png";
        String path48 = "EyjafjallaResources/img/power/PinkOceanPower_32.png";
        this.region128 = new TextureAtlas.AtlasRegion(ImageMaster.loadImage(path128),0,0,84,84);
        this.region48 = new TextureAtlas.AtlasRegion(ImageMaster.loadImage(path48),0,0,32,32);
        this.isTurnBased = true;
        this.type = PowerType.BUFF;
        this.updateDescription();
    }

    boolean cloudy;
    AbstractCard card = new Songs_Eyjafjalla();

    @Override
    public void atStartOfTurn() {
        this.flash();
        if(cloudy){
            addToBot(new MakeTempCardInCloudAction(card,1));
        }
        else
            addToBot(new MakeTempCardInHandAction(card,1));
    }

    @Override
    public void updateDescription() {
        this.description = powerStrings.DESCRIPTIONS[0] + (cloudy?powerStrings.DESCRIPTIONS[2]:powerStrings.DESCRIPTIONS[1]);
    }

    static {
        powerStrings = CardCrawlGame.languagePack.getPowerStrings(POWER_ID);
    }
}




